<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title>文书任务管理</title>
        <link rel="stylesheet" href="${ctx }/scripts/plugins/tab/ui.tabs.css" type="text/css" media="print, projection, screen">
        <script src="${ctx }/scripts/plugins/tab/ui.core.js" type="text/javascript"></script>
        <script src="${ctx }/scripts/plugins/tab/ui.tabs.js" type="text/javascript"></script>
		<link rel="stylesheet" type="text/css" href="${ctx }/styles/displaytag.css" />
		<script type="text/javascript">
			function SetCwinHeight(obj){
				var iframe = obj;
			  	if (document.getElementById){
			   		if (iframe && !window.opera){
			    		if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight){
			    			iframe.height = iframe.contentDocument.body.offsetHeight + 10;
			    		}else if(iframe.Document && iframe.Document.body.scrollHeight){
			    			iframe.height = iframe.Document.body.scrollHeight + 30;
			    		}
			   		}
				}
			}
			
			function initAddOrder(){
				art.dialog.open(
					ctx + "/initAddOrder.html?vipServiceId=${param.vipServiceId}", {
						title: "添加文书任务",
						width:"500px", 
						height:"400px",
						lock: true
					}
				);
			}

			function changeIframeSrc(id, src){
				$("#" + id).attr("src", src);	
			} 
			
            $(function() {
                $('#rotate > ul').tabs({ fx: { opacity: 'toggle' } });
            });
		</script>
	</head>
	<body>
		<div class="container_16">
			<div class="grid_16">
				<div class="content_top">
					<span>文书任务管理</span>
					<a href="${ctx }/initVipServiceInfo.html?id=${param.vipServiceId }" style="float: right;padding: 6px;"><input type="button" class="button" value="返回VIP专案主页"></a>
				</div>
				<div class="content_bottom">
					<div style="padding: 30px;">
						<table cellpadding="0" cellspacing="0" class="service_table">
							<tr>
								<th class="left">
									VIP服务专案号：${vipService.vipServiceId }
								</th>
								<th class="right">
									服务时间：<fmt:formatDate value="${vipService.startTime }" pattern="yyyy-MM-dd"/>&nbsp;&nbsp;至&nbsp;&nbsp;<fmt:formatDate value="${vipService.endTime }" pattern="yyyy-MM-dd"/>
								</th>
							</tr>
							<tr>
								<td colspan="2">
									<iframe id="userInfoIframe" name="userInfoIframe" onload="Javascript:SetCwinHeight(this)" src="${ctx }/doshowInfo.html?vipServiceId=${param.vipServiceId }" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
								</td>
							</tr>
						</table>
						<c:if test="${'ROLE_USER' ne currentRole.name and 'ROLE_EDITOR_IN_CHIEF' ne currentRole.name }">
							<a title="添加文书任务" href="javascript:void(0)" onclick="initAddOrder()"><img src="${ctx}/images/add_task.jpg" alt="添加文书任务"></a>
						</c:if>
						<display:table id="te" name="pageBean" pagesize="10" class="display_table" requestURI="" style="border-collapse: collapse;border-spacing: 0;">
							<display:column title="序号" value="${(pageBean.pageNumber - 1) * pageBean.objectsPerPage + te_rowNum }" style="width: 5%"/>
						 	<display:column title="文书类型" property="service.description" style="width: 30%"/> 	
						 	<display:column title="份数" property="schoolNum" style="width: 15%"/>
						 	<display:column title="状态" style="width: 30%">
						 		<c:choose>
						 			<c:when test="${te.finished }">
						 				<font color="green">已完成</font>
						 			</c:when>
						 			<c:otherwise>
						 				<font color="red">进行中</font>
						 			</c:otherwise>
						 		</c:choose>
						 	</display:column>
						    <display:column title="编辑" property="editor.user.name" style="width: 10%"/>  
						 	<display:column title="操作" style="width: 10%">
						 		<a href="http://www.cloudapply.com/user/transaction/workbench?t=${te.transaction.showId}.${te.id}" target="_blank">查看</a>
						 	</display:column>
						</display:table>
						<div id="rotate">
							<ul>
								<li>
									<a href="#ps" onclick="changeIframeSrc('psCommentIframe','${ctx }/commentList.html?ownerId=${param.vipServiceId}&ownerType=3')">
										<span>个人陈述(PS)</span>
									</a>
								</li>
								<li>
									<a href="#cv" onclick="changeIframeSrc('cvCommentIframe','${ctx }/commentList.html?ownerId=${param.vipServiceId}&ownerType=4')">
										<span>简历(CV)</span>
									</a>
								</li>
								<li>
									<a href="#rl" onclick="changeIframeSrc('rlCommentIframe','${ctx }/commentList.html?ownerId=${param.vipServiceId}&ownerType=5')">
										<span>推荐信(RL)</span>
									</a>
								</li>
								<li>
									<a href="#essay" onclick="changeIframeSrc('essayCommentIframe','${ctx }/commentList.html?ownerId=${param.vipServiceId}&ownerType=6')">
										<span>Essay</span>
									</a>
								</li>
							</ul>
							<div id="ps">
								<div style="float: right;">
									请下载 <a href="http://www.cloudapply.com/files/信息收集表/单份PS信息表.doc">个人陈述信息收集表.doc</a>，认真填写后上传。
								</div>
								<iframe id="psCommentIframe" name="psCommentIframe" onload="Javascript:SetCwinHeight(this)" src="${ctx }/commentList.html?ownerId=${param.vipServiceId}&ownerType=3" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
							</div>
							<div id="cv">
								<div style="float: right;">
									请下载 <a href="http://www.cloudapply.com/files/信息收集表/CV信息表.doc">简历信息收集表.doc</a>，认真填写后上传。
								</div>
								<iframe id="cvCommentIframe" name="cvCommentIframe" onload="Javascript:SetCwinHeight(this)" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
							</div>
							<div id="rl">
								<div style="float: right;">
									请下载 <a href="http://www.cloudapply.com/files/信息收集表/RL信息表.doc">推荐信信息收集表.doc</a>，认真填写后上传。
								</div>
								<iframe id="rlCommentIframe" name="rlCommentIframe" onload="Javascript:SetCwinHeight(this)" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
							</div>
							<div id="essay">
								<div style="float: right;">
									请下载 <a href="http://www.cloudapply.com/files/信息收集表/单份Essay信息表.doc">Essay信息收集表.doc</a>，认真填写后上传。
								</div>
								<iframe id="essayCommentIframe" name="essayCommentIframe" onload="Javascript:SetCwinHeight(this)" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
							</div>
						</div>
					</div>
				</div>
			</div>			
		</div>
	</body>
</html>		